
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCounterStore = defineStore( 'changeMode', () => {
  const index  = ref<boolean>(true)
  const mode =ref('light')
  const change = () => {
    index.value=!index.value

    if(index.value === true){ 
      mode.value = 'light'
    }
    if(index.value === false){
      mode.value = 'dark'
    }
  }
  return { index, mode,change }
})
export default useCounterStore